<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 最终显示的一定是最后一个过滤器返回的结果 -->
      <!-- 多个过滤器的顺序：从左往右依次调用，所以这里先调用sing，再调用dance，再调用rap，最后调用basketball -->
      <div>{{hobby | formatHobby | shit | basketball}}</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        data: {
          hobby: "❤️",
        },
        filters: {
          formatHobby(v) {
            return v + "👾"
          },
          shit(v) {
            return v + ", 😶‍🌫️"
          },
          basketball(v) {
            return v + ", 🏀"
          },
        },
      })
    </script>
  </body>
</html>
